package model

import (
	"gorm.io/gorm"
	__ "video-srv/basic/proto"
)

type Video struct {
	gorm.Model
	Title      string `gorm:"type:varchar(30);not null;comment:标题"`
	Content    string `gorm:"type:varchar(50);not null;comment:简介"`
	Label      string `gorm:"type:varchar(30);not null;comment:标签"`
	Permission string `gorm:"type:varchar(30);not null;comment:权限"`
	Image      string `gorm:"type:varchar(100);not null;comment:图片"`
}

func (v *Video) GetVideo(db *gorm.DB) (list []__.GetVideoList, err error) {

	err = db.Model(&Video{}).Select("title,content,label,image").Find(&v).Error
	return list, err
}
